package com.autumn.mybatis.model;

import com.autumn.mybatis.mapper.annotation.TableOrderBy;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;

/**
 * User
 * @author 老码农
 *
 * 2017-12-06 13:26:34
 */
@Entity
@Table(name = "Users_1")
@TableOrderBy(value = "name asc,id desc")
public class User extends PrimaryKey {

    private String name;
    private Integer age;
    private Date birthday;
    private Timestamp registration;
    private Double balance;


    @Id
    @Column(name = "userId")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Integer getId() {
        return this.id;
    }

    @Column(name = "username")
    public String getName() {
        return name;
    }

    @Column(name = "age")
    public Integer getAge() {
        return age;
    }

    @Column(name = "birthday")
    public Date getBirthday() {
        return birthday;
    }

    @Column(name = "registration")
    public Timestamp getRegistration() {
        return registration;
    }

    @Column(name = "balance")
    public Double getBalance() {
        return balance;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public void setRegistration(Timestamp registration) {
        this.registration = registration;
    }

    public void setBalance(Double balance) {
        this.balance = balance;
    }
}
